<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Common Module/pthread_lock.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_df4e0e4e72f77ab290fd1a24f190250a.html">Common Module</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">pthread_lock.h</div></div>
</div><!--header-->
<div class="contents">
<a href="pthread__lock_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#ifndef __PTHREAD_LOCK_H__</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#define __PTHREAD_LOCK_H__</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#endif </span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="structpthread__mutex__t.html">   31</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>{</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">   33</a></span>    uint8_t <a class="code hl_variable" href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">lock</a>; </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>} <a class="code hl_struct" href="structpthread__mutex__t.html">pthread_mutex_t</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">   42</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code hl_function" href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a>(<a class="code hl_struct" href="structpthread__mutex__t.html">pthread_mutex_t</a> *ptr)</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>{</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    <span class="keywordflow">if</span> (ptr-&gt;<a class="code hl_variable" href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">lock</a> != 0)</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    ptr-&gt;<a class="code hl_variable" href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">lock</a> = 1;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>}</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">   55</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a>(<a class="code hl_struct" href="structpthread__mutex__t.html">pthread_mutex_t</a> *ptr)</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>{</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    ptr-&gt;<a class="code hl_variable" href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">lock</a> = 0;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>}</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>}</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="preprocessor">#endif </span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="preprocessor">#endif </span><span class="comment">//__PTHREAD_LOCK_H__</span></div>
<div class="ttc" id="apthread__lock_8h_html_a4f08153d45685a64dd5901e150b988ef"><div class="ttname"><a href="pthread__lock_8h.html#a4f08153d45685a64dd5901e150b988ef">pthread_mutex_unlock</a></div><div class="ttdeci">static void pthread_mutex_unlock(pthread_mutex_t *ptr)</div><div class="ttdoc">解锁</div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00055">pthread_lock.h:55</a></div></div>
<div class="ttc" id="apthread__lock_8h_html_a5b24d442627e9343245d4a44daa81ada"><div class="ttname"><a href="pthread__lock_8h.html#a5b24d442627e9343245d4a44daa81ada">pthread_mutex_lock</a></div><div class="ttdeci">static uint8_t pthread_mutex_lock(pthread_mutex_t *ptr)</div><div class="ttdoc">加锁</div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00042">pthread_lock.h:42</a></div></div>
<div class="ttc" id="astructpthread__mutex__t_html"><div class="ttname"><a href="structpthread__mutex__t.html">pthread_mutex_t</a></div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00031">pthread_lock.h:32</a></div></div>
<div class="ttc" id="astructpthread__mutex__t_html_a92435efb84d6814afd444fd462802e9c"><div class="ttname"><a href="structpthread__mutex__t.html#a92435efb84d6814afd444fd462802e9c">pthread_mutex_t::lock</a></div><div class="ttdeci">uint8_t lock</div><div class="ttdoc">1-锁已占用 0-锁空闲</div><div class="ttdef"><b>Definition:</b> <a href="pthread__lock_8h_source.html#l00033">pthread_lock.h:33</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
